package com.seal.dao.impl;

import org.springframework.stereotype.Repository;

import com.seal.dao.BaseDaoImpl;
import com.seal.dao.ICompanyInfo2Dao;
import com.seal.model.CompanyInfo2;

@Repository("companyInfo2DaoImpl")
public class CompanyInfoDao2Impl extends BaseDaoImpl implements ICompanyInfo2Dao{

	public void addCompanyInfo2(CompanyInfo2 ca) throws Exception {
		this.save(ca);
	}

	public void updateCompanyInfo2(CompanyInfo2 ca) throws Exception {
		this.update(ca);
	}
	
	public CompanyInfo2 getCompanyInfo2ById(Long id,Short sid) throws Exception {
		CompanyInfo2 ca=(CompanyInfo2)this.getSessionFactory().getCurrentSession()
		.createQuery("from CompanyInfo2 t where t.companyId=? and t.sid=?")
		.setLong(0, id).setShort(1, sid).uniqueResult();
		if(ca!=null)return ca;
		return null;
		
	}
	
}
